home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLSRC.PAK / COMMDIAL.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.0 KB  |  85 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1992, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.8  $
  6. //
  7. // Implementation of Common Dialog abstract base class
  8. //----------------------------------------------------------------------------
  9. #include <owl/pch.h>
  10. #if !defined(OWL_COMMDIAL_H)
  11. # include <owl/commdial.h>
  12. #endif
  13. #if !defined(OWL_APPLICAT_H)
  14. # include <owl/applicat.h>
  15. #endif
  16.  
  17. //
  18. // Diagnostic group for Common Dialog
  19. //
  20. OWL_DIAGINFO;
  21. DIAG_DEFINE_GROUP_INIT(OWL_INI, OwlCommDialog, 1, 0);
  22.  
  23. DEFINE_RESPONSE_TABLE1(TCommonDialog, TDialog)
  24.   EV_WM_CLOSE,
  25.   EV_COMMAND(IDOK, CmOkCancel),
  26.   EV_COMMAND(IDCANCEL, CmOkCancel),
  27. END_RESPONSE_TABLE;
  28.  
  29. IMPLEMENT_CASTABLE(TCommonDialog);
  30.  
  31. //
  32. //
  33. //
  34. TCommonDialog::TCommonDialog(TWindow*        parent,
  35.                              const char far* title,
  36.                              TModule*        module)
  37. :
  38.   TDialog(parent, 0, module),
  39.   CDTitle(title)
  40. {
  41.   TRACEX(OwlCommDialog, OWL_CDLEVEL, "TCommonDialog constructed @" << (void*)this);
  42. }
  43.  
  44. //
  45. // Generate message in diagnostic libraries.
  46. //
  47. TCommonDialog::~TCommonDialog()
  48. {
  49.   TRACEX(OwlCommDialog, OWL_CDLEVEL, "TCommonDialog destructed @" << (void*)this);
  50. }
  51.  
  52. //
  53. // Override virtual to set the caption.
  54. //
  55. void
  56. TCommonDialog::SetupWindow()
  57. {
  58.   TRACEX(OwlCommDialog, 1, "TCommonDialog::SetupWindow() @" << (void*)this);
  59.  
  60.   TDialog::SetupWindow();
  61.   if (CDTitle)
  62.     SetCaption(CDTitle);
  63. }
  64.  
  65. //
  66. // Default handler for a modeless common dialog.
  67. // Wrong usage if here.
  68. //
  69. HWND TCommonDialog::DoCreate()
  70. {
  71.   TRACEX(OwlCommDialog, 0, "Wrong usage for a modal common dialog. Use Execute() instead.");
  72.   return 0;
  73. }
  74.  
  75. //
  76. // Default handler for a modal common dialog.
  77. // Wrong usage if here.
  78. //
  79. int TCommonDialog::DoExecute()
  80. {
  81.   TRACEX(OwlCommDialog, 0, "Wrong usage for a modeless common dialog. Use Create() instead.");
  82.   return IDCANCEL;
  83. }
  84.  
  85.